﻿using System;
using Microsoft.SmallBasic.Library;
using SmallBasicFun;

namespace Houses
{
	public class HouseVariation
	{
		static int height = 40;

		public static void Main()
		{
			Tortoise.Show();

			Tortoise.SetSpeed(8);

			Tortoise.SetX(200);

            height = 120;
            DrawHouse();
            height = 90;
            DrawHouse();
			height = 20;
			DrawHouse();
            height = 45;
            DrawHouse();
            height = 50;
            DrawHouse();
            height = 10;
            DrawHouse();

		}

		public static void DrawHouse()
		{
			//we can use random color here 
			Tortoise.SetPenColor(Colors.GetRandomColor());
			Tortoise.Move(height);

			//1. if the house is above 50, draw flat roof
		    if (height > 50)
		    {
		        DrawFlatRoof();
		    }
		    else
		    {
		        DrawPointyRoof();
		    }
			
			//2. if the house is lower than 50, draw pointy roof
			Tortoise.Move(height);
			Tortoise.Turn(-90);
			Tortoise.Move(20);
			Tortoise.Turn(-90);
			//DrawPointyRoof(); Tortoise.Move(height);
		 
		}
		public static void DrawFlatRoof()
		{
			Tortoise.Turn(90);
			Tortoise.Move(30);
			Tortoise.Turn(90);
			
		}
		public static void DrawPointyRoof()
		{
			//finish the code for pointy roof
            //1 turn 45
		    Tortoise.Turn(45);
		    //2 move 15
            Tortoise.Move(15);
		    //3 turn 90
            Tortoise.Turn(90);
		    //4 move 15
            Tortoise.Move(15);
		    //5 turn 45
            Tortoise.Turn(45);
		}
	}
}